#pragma once

class CSubcableTyingOperatorCmd;

class DEF_MODELTOOL SubCableTyingTool : public CHoopsTool
{
public:
	SubCableTyingTool(HBaseView *pView);
	~SubCableTyingTool(void);

	CSubCableTyingDisObj* CreateSubCableTying(list<CSubCableDisplayObj*> lstSubCableDis,double dPosX,double dPosY);
	list<CSubCableDisplayObj*> DeleteSubCableTying(CSubCableTyingDisObj* pTyingDis);
	void DealMoveAndAssoSubCableDisPts(CSubCableTyingDisObj* pTyingDis,double dNewPosX,double dNewPosY);

	bool IsMeetOperatorPreCondition();
	bool IsMeetOperatorCondition(CDisplayObj* pObj,const HPoint& mouseWinPos, HC_KEY kLastHighlight, 
		const std::vector<HC_KEY >& vecLastHighlight,const HPoint& mouseWorldPos,std::vector<CDisplayObj* > vecSelObjs);
	
	int MoveTyingPt(const HPoint& mouseWorldPos, HC_KEY kLastHighlight);

	void finishMove(const HPoint& mouseWorldPos, HC_KEY kLastHighlight);



private:
	HBaseView* m_pHView;
	bool m_bMoveTyingPt;	
	HPoint m_ptLButtonDown;
	CSubcableTyingOperatorCmd* m_pCmd;

};

